package woshiheima14;
import sun.reflect.generics.tree.Tree;


public class TestBinaryTree {
    public static void main(String[] args) {
        //创建一棵树
        BinaryTree binTree = new BinaryTree();
        //创建一个根节点
        TreeNode root = new TreeNode(1);
        //把根节点赋值给树
        binTree.setRoot(root);
        //创建两个节点
        //左节点
        TreeNode rootL= new TreeNode(2);
        root.setlNode(rootL);
        //右节点
        TreeNode rootR= new TreeNode(3);
        root.setrNode(rootR);

        //为第二层左子节点创建两个子节点
        rootL.setlNode(new TreeNode(4));
        rootL.setrNode(new TreeNode(5));
        //为第二层右节点创建两个子节点
        rootR.setlNode(new TreeNode(6));
        rootR.setrNode(new TreeNode(7));

        //前序遍历树
        //binTree.fronShow();
        //中序遍历
       // binTree.midShow();
        //后序遍历
        binTree.afterShow();

    }

}
